<?php

require_once 'smarty_lib/Smarty.class.php';
require_once 'lib/DBClass.php';
require_once 'lib/Member.php';
require_once 'lib/Game.php';

$smarty = new Smarty();
$acc = new Member();
$game = new Game();

$smarty->template_dir = 'template/';
$smarty->compile_dir = 'template_c/';

if(!$acc->validate_cookie()){
	$smarty->assign('error','Silahkan login terlebih dahulu!');
	$smarty->assign('title','Dashboard');
	$smarty->display('dashboard.html');
}else{
	$smarty->assign('page','game.html');
	$smarty->assign('title','Dashboard');
	$smarty->assign('cookie', $acc->get_cookie());
	$smarty->assign('game', $game->get_all_game());

	$smarty->display('dashboard2.html');
}
?>
